package net.lanelife.casino.caipiao.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import net.lanelife.casino.common.entity.annotation.Checked;
import net.lanelife.casino.common.entity.support.CheckableEntity;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Type;
import org.joda.time.DateTime;

@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "TB_ACTIVITY")
public class Activity extends CheckableEntity<Integer> {
	
	private static final long serialVersionUID = 424803107057320635L;

	@Checked
	@Column(name = "CODE", length = 10, nullable = false, unique = true)
	private String code;
	
	@Checked
	@Column(name = "NAME", length = 10, nullable = false)
	private String name;
	
	@Checked
	@Column(name = "CAPTION", length = 255, nullable = false)
	private String caption;
	
	@Column(name="BEGIN_TIME", nullable=false)
	@Type(type = "net.lanelife.casino.common.entity.usertype.PersistentDateTimeAsMillisLong")
	private DateTime beginTime;
	
	@Column(name="END_TIME", nullable=false)
	@Type(type = "net.lanelife.casino.common.entity.usertype.PersistentDateTimeAsMillisLong")
	private DateTime endTime;
	
	@Checked
	@Column(name = "URL", length = 255, nullable = false)
	private String url;
	
	@Checked
	@Column(name = "PRIZE_TYPE_CODE", length = 10, nullable = false)
	private String prizeTypeCode;
	
	@Checked
	@Column(name = "AVAILABLE", nullable = false)
	private Boolean available = Boolean.TRUE;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCaption() {
		return caption;
	}

	public void setCaption(String caption) {
		this.caption = caption;
	}

	public DateTime getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(DateTime beginTime) {
		this.beginTime = beginTime;
	}

	public DateTime getEndTime() {
		return endTime;
	}

	public void setEndTime(DateTime endTime) {
		this.endTime = endTime;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getPrizeTypeCode() {
		return prizeTypeCode;
	}

	public void setPrizeTypeCode(String prizeTypeCode) {
		this.prizeTypeCode = prizeTypeCode;
	}

	public Boolean getAvailable() {
		return available;
	}

	public void setAvailable(Boolean available) {
		this.available = available;
	}
	
}
